<template>
    <div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>ID</td>
                    <td>名称</td>
                    <td>价格</td>
                    <td>面积</td>
                    <td>入住人数</td>
                    <td>操作</td>
                </tr>
                <tr v-for="value in info">
                    <td>{{value.id}}</td>
                    <td>{{value.name}}</td>
                    <td>{{value.price}}</td>
                    <td>{{value.area}}</td>
                    <td>{{value.people}}</td>
                    <td><input type="button" value="修改" style="background-color: aqua;"></td>
                </tr>
            </tbody>
        </table>
        {{info}}
    </div>
</template>

<script setup lang="ts">
import router from '@/router';
import axios from 'axios'; 
import {ref,onMounted} from 'vue'

let info:any=ref([]);

onMounted(()=>{
    Show();
})


const Show=()=>{
    axios({
        url:'https://localhost:7229/api/Hotel/GetList',
        method:'get',
    })
    .then((res)=>{
        console.log(res);
        info.value=res.data
    })
    .catch((err)=>{
        console.log(err);
    })
}
</script>

<style scoped>

</style>